/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.financeiro.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.apache.commons.lang.builder.CompareToBuilder;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "processo_situacaoMorto", catalog = "salao", schema = "public")
@NamedQueries({
    @NamedQuery(name = "ProcessoSituacaoMorto.findAll", query = "SELECT p FROM ProcessoSituacaoMorto p")})
public class ProcessoSituacaoMorto implements Comparable<ProcessoSituacaoMorto>, Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    //@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "processoMorto_situacao_id_situacao_seq")
    //@SequenceGenerator(name = "processoMorto_situacao_id_situacao_seq", sequenceName = "processoMorto_situacao_id_situacao_seq", initialValue = 1, allocationSize = 1)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_situacao", nullable = false)
    private Integer idSituacao;
    @Column(name = "ass_data")
    @Temporal(TemporalType.DATE)
    private Date assData;
    @Size(max = 100)
    @Column(name = "ass_descricao", length = 100)
    private String assDescricao;
    @Size(max = 40)
    @Column(name = "ass_situacao", length = 40)
    private String assSituacao;
    @Size(max = 10)
    @Column(name = "ass_tipo", length = 10)
    private String assTipo;
    @Size(max = 10)
    @Column(name = "ass_color", length = 10)
    private String assColor;
    @JoinColumn(name = "id_processo", referencedColumnName = "id_processo", nullable = true)
    @ManyToOne(optional = true)
    private ProcessoMorto idProcesso;

    public ProcessoSituacaoMorto() {
    }

    public ProcessoSituacaoMorto(Integer idSituacao) {
        this.idSituacao = idSituacao;
    }

    public Integer getIdSituacao() {
        return idSituacao;
    }

    public void setIdSituacao(Integer idSituacao) {
        this.idSituacao = idSituacao;
    }

    public Date getAssData() {
        return assData;
    }

    public void setAssData(Date assData) {
        this.assData = assData;
    }

    public String getAssDescricao() {
        return assDescricao;
    }

    public void setAssDescricao(String assDescricao) {
        this.assDescricao = assDescricao;
    }

    public String getAssSituacao() {
        return assSituacao;
    }

    public void setAssSituacao(String assSituacao) {
        this.assSituacao = assSituacao;
    }

    public String getAssTipo() {
        return assTipo;
    }

    public void setAssTipo(String assTipo) {
        this.assTipo = assTipo;
    }

    public String getAssColor() {
        return assColor;
    }

    public void setAssColor(String assColor) {
        this.assColor = assColor;
    }

    public ProcessoMorto getIdProcesso() {
        return idProcesso;
    }

    public void setIdProcesso(ProcessoMorto idProcesso) {
        this.idProcesso = idProcesso;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSituacao != null ? idSituacao.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProcessoSituacaoMorto)) {
            return false;
        }
        ProcessoSituacaoMorto other = (ProcessoSituacaoMorto) object;
        if ((this.idSituacao == null && other.idSituacao != null) || (this.idSituacao != null && !this.idSituacao.equals(other.idSituacao))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.financeiro.entity.ProcessoSituacao[ idSituacao=" + idSituacao + " ]";
    }

    @Override
    public int compareTo(ProcessoSituacaoMorto obj) {
        return CompareToBuilder.reflectionCompare(this, obj);
    }
}
